export default {
    namespaced: true,
    actions: {

    },
    mutations: {
        SETAREAS(state,payload){
            state.areas = payload
        },
        SETMAP(state, map) {
            state.map = map
        },
        SETCITY(state, city) {
            window.sessionStorage.setItem('city', JSON.stringify(city));
        },

        SETCOUNTY(state, county) {
            window.sessionStorage.setItem('county', JSON.stringify(county));
        },
        SETBOUNDARYLAYER(state, boundaryLayer) {
            state.boundaryLayer = boundaryLayer;
        },
        SETICONLAYER(state, iconLayer) {
            state.iconLayer.push(iconLayer);
        },

    },
    state: {
        map: null,
        city: [],
        county: [],  
        //边界图层
        boundaryLayer: null,
       layer:[]
    },

    getters: {
        cloudLight(state) {
            return state.cloudLight;
        },
        cloudWater(state) {
            return state.cloudWater;
        },
        user(state) {
            return JSON.parse(window.sessionStorage.getItem('user'));
        },
        district(state) {
            return JSON.parse(window.sessionStorage.getItem('district'));
        },
        city(state) {
            return JSON.parse(window.localStorage.getItem('city'));
        },
        county(state) {
            return JSON.parse(window.localStorage.getItem('county'));
        },
        cloudInfra(state) {
            return state.cloudInfra;
        },
        cloudColour(state) {
            return state.cloudColour;
        },
        map(state) {
            return state.map;
        },
        boundaryLayer(state) {
            return state.boundaryLayer;
        },
        layer(state) {
            return state.layer;
        },
        iconLayer(state) {
            return state.iconLayer;
        },
        radarUrl(state) {
            return state.radarUrl;
        },
        cloudUrl(state) {
            return state.cloudUrl;
        },
        radar(state) {
            return state.radar;
        },
        radarAll(state) {
            return state.radarAll;
        },
    },
}
